home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 648 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1013 b 

  1. Path: solon.com!not-for-mail
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.lang.c.moderated,comp.std.c
  4. Subject: Re: 'h' modifier in printf
  5. Date: 25 Mar 1996 06:22:50 -0600
  6. Organization: CERN European Lab for Particle Physics
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4j636q$3hm@solutions.solon.com>
  10. References: <4i801c$455@solutions.solon.com> <4j06rd$82n@solutions.solon.com>
  11. NNTP-Posting-Host: solutions.solon.com
  12. X-Newsreader: NN version 6.5.0 #7 (NOV)
  13.  
  14. In <4j06rd$82n@solutions.solon.com> holdp@essex.ac.uk (Holden P) writes:
  15.  
  16. >printf("Vanilla %X\nWith h  %hX\n", -1, -1);
  17. >
  18. >says
  19. >
  20. >Vanilla FFFFFFFF
  21. >With h  FFFF
  22.  
  23. Since the type of -1 is not unsigned int and it appears in a context where
  24. the compiler is not required to perform the conversion, this example
  25. invokes undefined behaviour, hence it cannot be used to demonstrate
  26. anything.
  27.  
  28. Dan
  29. --
  30. Dan Pop
  31. CERN, CN Division
  32. Email: danpop@mail.cern.ch 
  33. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  34.